package com.example.demo;

import com.example.demo.api.SendPrivateMsg;
import com.example.demo.kiroBot.Voice;
import org.json.JSONArray;
import org.json.JSONObject;

import java.io.File;
import java.io.IOException;

public class text {
    public static void main(String[] args) {
        JSONObject jsonObject = new JSONObject();
        try {
            File file = Voice.generateVoiceFile("哼，月月这个懒虫，整天就知道偷懒！你还有什么脸活在世上啊？快去干活！不过要是你敢哭的话，我就饶不了你！");
            jsonObject.put("group_id","202180121");
            JSONArray jsonArray = new JSONArray();
            JSONObject tmp = new JSONObject();
            tmp.put("type","record");
            JSONObject data = new JSONObject();
            data.put("file",file.getAbsolutePath());
            tmp.put("data",data);
            jsonArray.put(tmp);
            jsonObject.put("message",jsonArray);
            System.out.println(jsonObject);
            SendPrivateMsg.SendPostRequest(jsonObject.toString());
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
